package com.foreveross.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * SysRoleMenu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_role_menu", catalog = "hrtenement")
public class SysRoleMenu implements java.io.Serializable {

	// Fields

	private String id;
	private SysMenu sysMenu;
	private SysRole sysRole;

	// Constructors

	/** default constructor */
	public SysRoleMenu() {
	}

	/** minimal constructor */
	public SysRoleMenu(String id) {
		this.id = id;
	}

	/** full constructor */
	public SysRoleMenu(String id, SysMenu sysMenu, SysRole sysRole) {
		this.id = id;
		this.sysMenu = sysMenu;
		this.sysRole = sysRole;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="idGenerator", strategy="uuid")
	@GeneratedValue(generator="idGenerator") 
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "menu_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public SysMenu getSysMenu() {
		return this.sysMenu;
	}

	public void setSysMenu(SysMenu sysMenu) {
		this.sysMenu = sysMenu;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "role_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public SysRole getSysRole() {
		return this.sysRole;
	}

	public void setSysRole(SysRole sysRole) {
		this.sysRole = sysRole;
	}

}